package com.diqye.templet.regullation;

import com.diqye.templet.core.Regullation;
/**
 * 字符串替换
 *
 * @author 秦振龙
 * @date 2013-7-8
 *
 * <b>修改记录及说明：</b>
 * <ul>
 * <li>2013-7-8  秦振龙  创建</li>
 * </ul>
 */
public class StrRegullation implements Regullation {
	
	private String str;
	public StrRegullation(String str){
		this.str = str;
	}
	
	public boolean invok(String context, int[] start, int[] end) {
		int r = context.indexOf(str, start[0]);
		if(r != -1){
			start[0] = r;
			end[0] = r + str.length();
			return true;
		}
		
		return false;
	}

}
